﻿function PagingList(catid, pageindex) {

    $.ajax({
        url: "/ajax/newslist.aspx",
        type: "POST",
        data: { "cat_id": catid, "pageindex": pageindex },
        cache: false,
        beforeSend: function () {
            
            $('#divLoadding').attr('display:none');
        },
        success: function (data) {
            $('.card-list').html
        }
    });
}

function LoadNews(catid) {
    $("#btMore").hide();
    $("#imgLoading").show();
    GetListNews(catid);
}
var pageIndex = 1;
function GetListNews(catid) {

    pageIndex++;
    if (pageIndex > 1) {
        $("#divLoadding").show();
        $.ajax({
            type: "GET",
            url: "/ajax/newslist.aspx",
            data: { "cat_id": catid, "pageindex": pageIndex },
            success: OnSuccess,
            failure: function (response) {
                alert(response.d);
            },
            error: function (response) {
                alert(response.d);
            }
        });
    }
}

function OnSuccess(response) {
    $('#divListNews').append(response);
    /*$("#divLoadding").hide();*/
    $("#btMore").show();
    $("#imgLoading").hide();
}

function Search(key) {
    var url = "/search.aspx?key=" + key;
    $(location).attr('href', url);
}


